perf(ds4): accelerate prefill via gpu-resident hc pipeline and intra-warp flash attention - #634
Closed
cheese-cakee wants to merge 6 commits into
Closed
perf(ds4): accelerate prefill via gpu-resident hc pipeline and intra-warp flash attention#634cheese-cakee wants to merge 6 commits into
cheese-cakee wants to merge 6 commits into
Conversation
…d preserve cuda mmq fallback
…warp flash attention
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 5 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Contributor
Author
|
Closing PR #634 after maintainer audit: confirmed that the throughput delta was an attribution artifact from default-enabling the existing GPU-HC path, while the fattn.cu warp-shuffle changes yielded zero net gain on dual-GPU and regressed Strix-only by 4.3% due to VALU/VGPR contention. Closing to keep the queue clean as we focus on Grouped MoE GEMM. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on PR #633 (
codex/perf-ds4-prefill-phase1).This change accelerates chunked prefill on DeepSeek-V4 from$1.73\times$ speedup over PR #633, $15.17\times$ over pre-633 dual baseline).
130.84 tok/sto225.83 tok/ssustained (225.85 tok/speak) on dual-GPU AMD ROCm target hardware (gfx1151;gfx1201), reducing 3,960-token prompt latency from 30.26s down to 17.53s (Key Architectural Changes
GPU-Resident HC Pipeline by Default (
deepseek4_graph.cpp):use_backend_prefill_hc).DFLASH_DS4_DISABLE_HYBRID_PREFILL_GPU_HCas an explicit safety opt-out escape hatch.Intra-Warp Shuffle Reductions (
fattn.cu):blockDim.x / 2loops with 16__syncthreads()) with single-cycle__shfl_xor(HIP) /__shfl_xor_sync(CUDA) intra-warp reductions.Branchless$D=512$ Attention Loop Splitting (
fattn.cu):128-Bit Vectorized Global Memory Stores (
fattn.cu):float4and 64-bitfloat2global store instructions (global_store_dwordx4on AMD GCN/RDNA).API Documentation Alignment (
deepseek4_internal.h):deepseek4_steppopulatesout_logitsonly whenneed_logits=true, leavingout_logitsempty whenneed_logits=false.Hardware Scope (Strix-Only vs Dual-GPU)
gfx1151APU): Fully enabled. Wave32 shuffle reductions compile directly to hardware permute instructions (v_permlane16_b32/v_permlanex16_b32). Single-GPU execution usesds4_try_layer_major_prefillwhich executes monolithic GPU graphs on Strix Halo with zero host roundtrips.gfx1201+gfx1151): Fully enabled. GPU-resident HC graphs eliminate 86 cross-device synchronization sync points per token chunk.Measured Prefill Performance
Model: 96 GB DeepSeek V4 (
DeepSeek-V4-Flash-ROCMFP2-STRIX.gguf, 43 layers)Prompt: 3,960 tokens (
long_code_audit.txt,chunk=512)Hardware: Dual AMD GPU (Radeon AI PRO R9700
gfx1201+ Ryzen AI MAX+ 395gfx1151, ROCm 7.2.4)Live Multi-Condition Serial Test Results
Executed serially on live hardware with clean server lifecycle per configuration:
GPU_HC=0)Determinism & Generation Quality
8d1ca74caeecec5f2b52300735692c95dd6d7e83e6e0734d3cb8daacfc85e5a9).OK) on dual ROCm 7.2.4 (gfx1151;gfx1201) and local SM 8.9 CUDA.git diff --check: Clean (zero formatting or whitespace errors).